package org.sfilo.downloader;

import junit.framework.TestCase;

public class SiteFileFetchTester extends TestCase
{
	
	private static final String HTTP_WWW_INFOSEC_COM_CN_DOWNLOAD_NET_GATESSLVPN_V1_RAR = "https://10.100.116.201:8443/console/1.wmv";
	public void testDownload() throws Exception
	{
		long start=System.currentTimeMillis();
		SiteInfoBean bean = new SiteInfoBean();
		bean.setDestFileName("1.wmv");
		bean.setUrl(HTTP_WWW_INFOSEC_COM_CN_DOWNLOAD_NET_GATESSLVPN_V1_RAR);		
		bean.addHeader("Referer","http://www.skycn.com/soft/40349.html");
		SiteFileFetch fetch = new SiteFileFetch(bean,10);
		fetch.work();
		while(!fetch.isComplete());
		long end=System.currentTimeMillis();
		System.out.println("cost time="+(float)(end-start)/1000);
	}
}
